# from PIL import Image,ImageDraw

# #读图
# im= Image.open("./code.png")

# print(im.format,im.size,im.mode)

# #result:PNG (120, 50) RGB

# #生成画笔
# draw = ImageDraw.Draw(im)

# #绘制
# draw.text((0,0),'1907',fill=(76,234,124,180))
# im.show()

# im.show()


#图片压缩
#读图
from cv2 import cv2 as cv 
img = cv.imread('./code.png')
  
#压缩  这里png  还有jpg的  png范围0~10 jpg范围0~100
cv.imwrite('./mama.png',img,[cv.IMWRITE_PNG_COMPRESSION,5])